﻿
{include file="common/top"}


<div id="page-wrapper">
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <h1 class="page-head-line">管理员列表</h1>
                <h1 class="page-subhead-line"></h1>

            </div>
        </div>
        <!-- /. ROW  -->
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        管理员管理
                    </div>
                    <div class="panel-body">

                        <form method="post" action="" id="listform">
                            <div class="panel admin-panel">
                                <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong>
                                    <a class="button button-little bg-red" href="/admin/add"><span
                                            class="icon-power-off"></span> 添加后台管理员</a>
                                </div>

                                <table class="table table-hover text-center">
                                    <tr>
                                        <th>ID</th>
                                        <th>登录账号</th>
                                        <th>用户真实姓名</th>
                                        <th>权限</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>

                                    {volist name="admin" id="vo"}
                                    <tr>
                                        <td >{$vo.id}</td>
                                        <td> {$vo.username}</td>
                                        <td>{$vo.realname} </td>
                                        <td>{$vo.type=='1'?'超级管理员':'普通管理员'} </td>
                                        <td>{$vo.created_at|date="Y-m-d H:i:s"}</td>
                                        <td>
                                            <div class="button-group">
                                                <!--                        <a class="button border-main" href="add.html"><span class="icon-edit"></span> 修改</a>-->

                                                <!--                            <a class="button border-red" href="/admin/delete?id={$vo.id}"><span class="icon-trash-o"></span> 删除</a>-->
                                                <a class="button border-red" href="javascript:;" onclick="del({$vo.id})"><span class="icon-trash-o"></span> 删除</a>
                                            </div>
                                        </td>
                                    </tr>
                                    {/volist}

                                    <tr>
                                        <td colspan="8"><div class="pagelist"> <a href="">上一页</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一页</a><a href="">尾页</a> </div></td>
                                    </tr>
                                </table>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <!-- /. PAGE INNER  -->
    </div>

    <script type="text/javascript">
        function del(id){
            layer.confirm('你确定要删除吗？这可是一个作死的行为',function(){

                $.ajax({
                    type:'delete',
                    url:'/admin/admin/'+id,
                    datetype:'json',
                    success:function(data){
                        if(data.status=='success'){
                            layer.msg(data.msg),{icon:1};
                        }else{
                            layer.mag(data.msg),{icon:2};
                        }
                        location.href='/admin/list';
                    }
                })
            })
        }

    </script>
    {include file="common/out"}
